package psi.controllers;

import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.ext.interceptor.POST;

import psi.common.Result;
import psi.services.UserService;

public class UserController extends Controller {
	
	public void login() {
		setAttr("title", "登录");

		setAttr("demoInfo", "");

		render("login.html");
	}

	@Before(POST.class)
	public void loginPOST() {
		String loginName = getPara("loginName");
		String password = getPara("password");
		Result result = new UserService().doLogin(loginName, password);
		renderJson(result);
	}
}
